package pt.compflow.interfaces.task;

import pt.compflow.Context;
import pt.compflow.flowontology.model.Assignment;
import pt.compflow.flowontology.model.FlowOntologyModel;
import pt.compflow.flowontology.model.Task;
import pt.compflow.flowontology.model.Worker;
import pt.compflow.interfaces.IOInterface;
import pt.compflow.storage.TripleStoreConnection;
import pt.compflow.tools.OntModelHelper;

public interface TaskInterface extends IOInterface {
		
	/**
	 * BUSY: the worker is handling an Task Unit through this interface
	 * WAITING: the worker is free through this interface
	 */
//	public enum State { BUSY, WAITING }
	
	public void request(Context context, TripleStoreConnection store, OntModelHelper ontModelHelper, FlowOntologyModel jobModel, FlowOntologyModel engineModel, String jobUri, Task task);
	public void request(Context context, TripleStoreConnection store, OntModelHelper ontModelHelper, FlowOntologyModel jobModel, FlowOntologyModel engineModel, String jobUri, Worker worker, Assignment assignment);
	
	public void cancel(Context context, TripleStoreConnection store, OntModelHelper ontModelHelper, FlowOntologyModel jobModel, FlowOntologyModel engineModel, String jobUri, Task task);
	public void cancel(Context context, TripleStoreConnection store, OntModelHelper ontModelHelper, FlowOntologyModel jobModel, FlowOntologyModel engineModel, String jobUri, Assignment assignment);
	
//	public State getState();
//	
//	public int getMaxConcurrentAssignments();
//	public List<Assignment> getRunningAssignments();
	
	
	public boolean onTaskAccepted(String jobUri, Worker worker, Task task);
	public boolean onAssignmentSolved(String jobUri, Worker worker, Task task, Assignment assignment);	
//	
//	public List<Task> getVisibleTasks(Worker worker);
//	public List<Task> getAcceptedTasks(Worker worker);
			
}
